<script>
    $(function(){
        EBCMS.INSTALL.gotostep3 = function gotostep3(){
            EBCMS.CORE.submit({
                url: '{:url('install/index/index')}',
                form:'INSTALLForm',
                success:function(data){
                    if (data.code) {
                        EBCMS.INSTALL.step('3');
                    }else{
                        alert(data.msg);
                    };
                },
                error:function(a,b,c){
                    alert('数据库不存在或账号密码错误！');
                }
            });
        };
    });
</script>
<form id="INSTALLForm">
    <div class="license">
        <div class="form-group">
            <div class="input-group">
                <div class="input-group-addon">数据库地址:</div>
                <input type="text" name="hostname" value="127.0.0.1" class="form-control" id="hostname" placeholder="hostname">
            </div>
        </div>
        <div class="form-group">
            <div class="input-group">
                <div class="input-group-addon">数据库端口:</div>
                <input type="text" name="hostport" value="3306" class="form-control" id="hostport" placeholder="hostport">
            </div>
        </div>
        <div class="form-group">
            <div class="input-group">
                <div class="input-group-addon">数据库名称:</div>
                <input type="text" name="database" value="" class="form-control" id="database" placeholder="database">
            </div>
        </div>
        <div class="form-group">
            <div class="input-group">
                <div class="input-group-addon">数据库账户:</div>
                <input type="text" name="username" value="root" class="form-control" id="username" placeholder="username">
            </div>
        </div>
        <div class="form-group">
            <div class="input-group">
                <div class="input-group-addon">数据库密码:</div>
                <input type="text" name="password" value="root" class="form-control" id="password" placeholder="password">
            </div>
        </div>
        <div class="form-group">
            <div class="input-group">
                <div class="input-group-addon">数据表前缀:</div>
                <input type="text" name="prefix" value="ebcms5_" class="form-control" id="prefix" placeholder="prefix">
            </div>
        </div>
        <div class="form-group">
            <div class="input-group">
                <div class="input-group-addon">邮<span style="color:#eee;">一一一</span>箱:</div>
                <input type="text" name="manager_email" class="form-control" id="manager_email" placeholder="电子邮箱">
            </div>
        </div>
        <div class="form-group">
            <div class="input-group">
                <div class="input-group-addon">密<span style="color:#eee;">一一一</span>码:</div>
                <input type="text" name="manager_password" class="form-control" id="manager_password" placeholder="密码">
            </div>
        </div>
        <div class="form-group">
            <div class="input-group">
                <div class="input-group-addon">确认<span style="color:#eee;">一</span>密码:</div>
                <input type="text" name="manager_password2" class="form-control" id="manager_password2" placeholder="再次输入密码">
            </div>
        </div>
        <input type="hidden" name="step" value="2">
    </div>
    <div class="toolbar">
        <div class="pull-right">
            <button type="button" class="btn btn-primary" onclick="EBCMS.INSTALL.step(1);">上一步</button>
            <button type="button" class="btn btn-primary" onclick="EBCMS.INSTALL.gotostep3();">下一步</button>
        </div>
        <label for="demodatabase1"><input type="radio" name="demodatabase" value='1' id="demodatabase1" checked="checked"/> 安装演示数据</label>
        <label for="demodatabase0"><input type="radio" name="demodatabase" value='0' id="demodatabase0"/> 安装纯净版</label>
    </div>
</form>